package com.avic.modules.statistics.service.mapper;

import com.avic.common.mapper.CoreMapper;
import com.avic.modules.statistics.domain.MonthlyStatusRecord;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhangzikang
 * @date 2022-10-18
 */
@Repository
@Mapper
public interface MonthlyStatusRecordMapper extends CoreMapper<MonthlyStatusRecord> {

    /**
     * 清空表数据
     */
    @Delete("TRUNCATE TABLE monthly_status_record")
    void del();

    /**
     * 根据设备id查询数据
     * @param equipId
     * @return
     */
    @Select("select id,status,creation_date,equip_id from monthly_status_record where equip_id = #{equipId}")
    List<MonthlyStatusRecord> selectMonthlyStatistics(@Param("equipId")String equipId);
}
